home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Testing & Debugging / Virtual User tools / SPEC S&L v.1.0.1 / Scripts / Persuasion.vu < prev    next >
Encoding:
Text File  |  1993-12-17  |  9.7 KB  |  261 lines  |  [TEXT/MPS ]

  1. #
  2. # ****************************************************************************
  3. #
  4. #    File Name:        Persuasion.vu
  5. #
  6. #    Contains:    Quick look test script for Persuasion version 2.12
  7. #
  8. #    Written by:    Kevin Avoy, Ken Landreth, Michael Leong, Gil Spencer et al
  9. #
  10. #    Copyright:    © 1993 by Apple Computer, Inc., all rights reserved.
  11. #
  12. # ****************************************************************************
  13. #            C h a n g e        H i s t o r y (most recent first):
  14. # ****************************************************************************
  15. #
  16. #        Vers      Date        Author        Description
  17. #        ----    --------    ------    ---------------------------------------------
  18. #     <1.0.6>     9/30/93    KTA        Initialize gFileName prior to gApptitle being updated by
  19. #                                    launchTwitch().
  20. #     <1.0.5>     9/28/93    KTA        Added returnVal for ModifyDocument hook.
  21. #     <1.0.2>     6/16/93    NAGA        Renaming InitGlobals(ScriptLevel)to InitGlobals(ScriptLevel)
  22. #        <1+>     5/25/93    NAGA        Adding header and porting old files to follow new standards
  23. #
  24. # ****************************************************************************
  25. #
  26.  
  27.  
  28.  
  29. ########################################################################
  30. #                            External libraries 
  31. #=======================================================================
  32. Libraries "Output.Lib", "DoTasks.Lib","Draw.Lib","Print.Lib","UserInterface.Lib","DA.Lib", "Font.Lib", "Globals.Lib", "LaunchQuit.Lib", "TCS.Lib";
  33.  
  34.  
  35. #########################################################################
  36. ########               Application Specific Tasks
  37. #########################################################################
  38.  
  39. #########################################################################
  40. #                        InitAppGlobals()
  41. #========================================================================
  42. # Author:        KL
  43. # Description:    Sets up the tool palette for Persuasion.  This task
  44. #                must be called first.
  45. # Parameters:    None
  46. # Returns:        Nothing
  47. # Examples:        InitAppGlobals()
  48. #========================================================================
  49. # History:
  50. #
  51. ########################################################################
  52. task InitAppGlobals()
  53. begin
  54.     
  55.     logstr("setting up {global gApptitle}'s globals");            
  56.     global kClick, kDrag, kMultiDrag, kMultiClickDrag, kMultiClick;
  57.     global kPalDocWind, kPalWind, kPullOffPal, kPopUpPal, kScrollPal;
  58.     global kToolPaletteNum := 1; 
  59.     global kTextAttribPaletteNum := 2;
  60.  
  61.     global gTextStr;
  62.     
  63.     global gPaletteList :=    {
  64.                             {                        #### Start Palette #1 - Tools
  65.                             {0,19,23,235,0},        # Location of tools palette relative to the window
  66.                             kPalDocWind,            # Palette type
  67.                             {1,12},                    # Size of Tool matrix {numElemsWide,numElemsTall}
  68.                             {0,18},                    # Offset between tools {h,v}
  69.                             0,                        # Not used at this time
  70.                             0                        # Not used at this time
  71.                             }                        #### End Palette #1
  72.                             
  73.     };
  74.     
  75.  
  76.     ### Persuasion                                                                            {Flag, Pattern, Line, Color}
  77.     ### Palette Elements:=           Tool#, Pal#,         ToolName,             ToolType,    DblClktoEnd        SetAttributes
  78.     global SelectTool :=             { 1,    1,            "Select",            kClick,            0,                {0}                };
  79.     global TextTool :=                 { 2,       1,            "Text",                kClick,            0,                {}        };
  80.     global StrtLineTool :=             { 3,    1,            "Straight Line",    kDrag,            0,                {0}                };
  81.     global LineTool :=                 { 4,    1,            "Line",                kDrag,            0,                {0}                };
  82.     global RectTool :=                 { 5,       1,            "Rect",                kDrag,            0,                {0}                };
  83.     global RndRectTool :=             { 6,       1,            "RndRect",            kDrag,            0,                {0}                };
  84.     global OvalTool :=                 { 7,       1,            "Oval",                kDrag,            0,                {0}                };
  85.     global ArcTool :=                { 8,    1,            "Arc",                kDrag,            0,                {0}                };
  86.     global FreeFormTool :=             { 9,    1,            "Free Form",        kMultiDrag,        0,                {0}                };
  87.     global PolygonTool :=             {10,    1,            "Polygon",            kMultiClick,     1,                {0}                };
  88.     global ZoomInTool :=            {11,    1,            "Zoom In",            kClick,                 0,                {0}                };
  89.     global ZoomOutTool :=            {12,    1,            "Zoom Out",            kClick,                 0,                {0}                };
  90.     
  91.     global OutlineViewTool :=         {'',  {-9,28,3},    "OutlineView",        0,                0,                {0}                };
  92.     global SlideViewTool :=         {'',  {-9,46,3},    "SlideView",        0,                0,                {0}                };
  93.     global NotesViewTool :=         {'',  {-9,67,3},    "NotesView",        0,                0,                {0}                };
  94.  
  95.     global gToolList:={    #SelectTool,
  96.                         #TextTool,
  97.                         StrtLineTool,
  98.                         LineTool,
  99.                         RectTool,
  100.                         RndRectTool,
  101.                         OvalTool,
  102.                         ArcTool,
  103.                         FreeFormTool,
  104.                         PolygonTool#,
  105.                         #ZoomInTool,        # These tools appear to cause VU to timeout
  106.                         #ZoomOutTool        # These tools appear to cause VU to timeout
  107.     };
  108.                         
  109.         ### font characteristic lists
  110.     global gFontSizeList := {'9','10','12','14','18', '24','72'};
  111.     global gFontStyleList := {'Bold','Italic','Outline', 'Underline','Shadow',
  112.                                 'Superscript','Subscript'};
  113.     
  114.         ### Name of the Plain (style) menu item  ####
  115.     global gPlainStyle := "Plain";            # Plain-Style menu item
  116.  
  117.         ### How to get to the next line
  118.     global gNextLineMethod := 1;            
  119.         ### 1 - ReturnKey,  2 - EnterKey, 3 - DownArrow Key, 4 - TabKey, {} - Move/Click, {'Untitled'} - Move relative to the window titled 'Untitled' /Click
  120.     
  121.         ### Does moving to the next line clear all font info
  122.     global gNextLineClearsFontSettings := 0;
  123.     
  124.     global gWindowInset := {30,20,20,20};    # Inset to wind to get content region
  125.     
  126. end;    #InitAppGlobals
  127.  
  128. #########################################################################
  129. #                            PersuasionScrapPict()
  130. #========================================================================
  131. # Author:        
  132. # Description:    Test ScrapPict.
  133. # Parameters:    None
  134. # Returns:        Nothing
  135. # Examples:        PersuasionScrapPict();
  136. # Assumptions:    None 
  137. # Applications:    Persuasion
  138. #========================================================================
  139. # History:
  140. #
  141. ########################################################################
  142. task PersuasionScrapPict()
  143. begin
  144.     Logstr("Setting up for ScrapPict");        
  145.     SelectMenuItem("1", "Go To Slide",     "View");
  146.     Scrapbook(global kScrapPICT);
  147. end;
  148. #########################################################################
  149. #                            PersuasionSetupDoText()
  150. #========================================================================
  151. # Author:        
  152. # Description:    Test ScrapPict.
  153. # Parameters:    None
  154. # Returns:        Nothing
  155. # Examples:        PersuasionSetupDoText();
  156. # Assumptions:    None 
  157. # Applications:    Persuasion
  158. #========================================================================
  159. # History:
  160. #
  161. ########################################################################
  162. task PersuasionSetupDoText()
  163. begin
  164.     Logstr("Setting up for DoText");        
  165.     Draw(global TextTool);
  166. end;
  167.  
  168. #########################################################################
  169. #                            Views()
  170. #========================================================================
  171. # Author:        
  172. # Description:    Change views.
  173. # Parameters:    None
  174. # Returns:        Nothing
  175. # Examples:        Views();
  176. # Assumptions:    None 
  177. # Applications:        Persuasion
  178. #========================================================================
  179. # History:
  180. #
  181. ########################################################################
  182. task Views() begin
  183.     LogStr( "Changing Views");
  184.     SelectMenuItem("1", "Go To Slide",     "View");
  185.     SelectMenuItem("Slide Sorter",         "View");
  186.     SelectMenuItem("Outline",             "View");
  187.     SelectMenuItem("Notes",             "View");
  188.     SelectMenuItem("1", "Go To Slide",     "View");
  189. end;
  190.  
  191. #########################################################################
  192. #                            PersuasionModifyDocument()
  193. #========================================================================
  194. # Author:        ML
  195. # Description:    Modify Persuasion Document
  196. # Parameters:    None
  197. # Returns:        Nothing
  198. # Examples:        PersuasionModifyDocument();
  199. # Assumptions:    None 
  200. # Applications:    Persuasion
  201. #========================================================================
  202. # History:
  203. #
  204. ########################################################################
  205. task PersuasionModifyDocument()
  206. begin
  207.     return(Scrapbook(global kScrapTEXT));
  208. end;
  209.  
  210. #########################################################################
  211. #                            PersuasionPageSetup()
  212. #========================================================================
  213. # Author:        ML
  214. # Description:    Test Page Setup
  215. # Parameters:    None
  216. # Returns:        Nothing
  217. # Examples:        PersuasionPageSetup();
  218. # Assumptions:    None 
  219. # Applications:    Persuasion
  220. #========================================================================
  221. # History:
  222. #
  223. ########################################################################
  224. task PersuasionPageSetup()
  225. begin
  226.     PageSetup();
  227.     SpecialKey(returnKey , "Return Key");    # dismiss extra dialog
  228. end;
  229.  
  230. ################################################################################
  231. ####################             Main script                    ####################
  232. ################################################################################
  233. script Persuasion (ScriptLevel:= -1)
  234. begin
  235.     InitGlobals(ScriptLevel);            # initialize your general globals
  236.     InitDraw();
  237.     InitFonts();
  238.     global gAppTitle := 'Persuasion';
  239.     global gAppVersion := '2';        # version of app you will be running
  240.     global gFileName := "@!@-{gBuildVers}-{gAppTitle}";    # This is used in SaveAs when saving files
  241.     SuiteStart('Persuasion.vu');                    # begin a new test suite
  242.     if LaunchTwitch("{gAppTitle}",gAliasDirectory) # launch or twitch to your app
  243.     begin
  244.         global gCustomScrapPict:= task PersuasionScrapPict; # define app specific task            InitAppGlobals();                                    # init app specific globals
  245.         global gSetupDoText:= task PersuasionSetupDoText;    # define app specific task
  246.         global gModifyDocument:= task PersuasionModifyDocument; # define app specific task
  247.         InitAppGlobals();                                    # init app specific globals
  248.         (*
  249.         *)
  250.         DoSetUpApp(,,,,1,1);
  251.         DoDraw();
  252.         #DoText();    # Not done - typing text in Persuasion disables VU!
  253.         Views();
  254.         DoWindow();
  255.         PersuasionPageSetup();
  256.         DoCloseApp(1,,0);    # extra dialog in page setup
  257.         LogStr("############################# LIMITATIONS: ############################");
  258.         LogStr("NOTE: DoText not done because typing text in Persuasion disables VU");
  259.     end; # if LaunchTwitch("{gAppTitle}",gAliasDirectory)
  260.     SuiteEnd();
  261. end; # script Persuasion